Add GStreamer AI_ML test suite#279
Conversation
|
@vijpatel22 Please update the script's execute permissions and address the errors reported by shelllint. https://github.com/qualcomm-linux/qcom-linux-testkit/actions/runs/21785074948/job/62885941654?pr=279 |
|
Hi @smuppand, I’ve pushed the latest changes. Could you please review. |
| # Optional: make sure we have network connectivity (kept from the | ||
| # original script) | ||
| # ------------------------------------------------------------------ | ||
| if command -v ensure_network_online >/dev/null 2>&1; then |
There was a problem hiding this comment.
- Skip download if required assets already exist (non-empty).
- Otherwise bring up Ethernet first (get_ethernet_interfaces, bringup_interface, try_dhcp_client_safe) and re-check connectivity (check_network_status / ensure_network_online).
- If Ethernet fails, try Wi-Fi fallback using get_wifi_interface + get_wifi_credentials + wifi_connect_nmcli/wifi_connect_wpa_supplicant + DHCP.
- If still offline/limited → SKIP (not FAIL), since downloads can’t proceed.
There was a problem hiding this comment.
Hi @smuppand , thanks for the feedback. The function ensure_network_online function already implements:
- First checking Ethernet interfaces (using get_ethernet_interfaces, bringup_interface, try_dhcp_client_safe/run_dhcp_client)
- If Ethernet fails, trying Wi-Fi (using get_wifi_interface, get_wifi_credentials, wifi_connect_nmcli/wifi_connect_wpa_supplicant)
- If both fail, returning 1 (which would result in a SKIP in the calling context)
So, it seems the current ensure_network_online function already does what the comment is asking for.
There was a problem hiding this comment.
I have added the skip download part if required assets already exists, in latest commit.
There was a problem hiding this comment.
I have added the skip download part if required assets already exists, in latest commit.
asset presence should be checked before forcing network bring-up. Right now the function calls ensure_network_online first, so an offline target can still SKIP even when all required assets are already cached locally. The flow should be:
- first verify all required assets exist and are non-empty
- only if any are missing, bring up network and download
- if network still cannot be brought up, then SKIP
| - REPO_PATH=$PWD | ||
| - cd Runner/suites/Multimedia/GSTreamer/AI_ML/ | ||
| - ./run.sh --timeout "${TIMEOUT}" --gstdebug "${GST_DEBUG_LEVEL}" --output-video "${OUTPUT_VIDEO_PATH}" || true | ||
| - $REPO_PATH/Runner/utils/send-to-lava.sh AI_ML.res || true No newline at end of file |
There was a problem hiding this comment.
No newline at end of file.
Run.sh should handle proper exits, so there's no need to use || true for the send-to-lava.sh step.
|
|
||
| ### PASS | ||
| - **All pipelines** successfully run to PLAYING state without critical errors | ||
| - Output file contains `PASS AI_ML` |
There was a problem hiding this comment.
but your existing testkit convention is AI_ML PASS / AI_ML FAIL, and this run.sh currently prints PASS AI_ML format.
|
|
||
| ### FAIL | ||
| - **Any pipeline** fails to reach PLAYING state or encounters critical errors | ||
| - Output file contains `FAIL AI_ML` |
| # Source the environment and helper libraries. | ||
| # ---------------------------------------------------------------------- | ||
| # shellcheck disable=SC1090 | ||
| . "$INIT_ENV" |
There was a problem hiding this comment.
init_env sourcing is wrong (double-source + idempotence variable)
Runner/utils/lib_gstreamer.sh
Outdated
| TIMEOUT=${timeout:-60} # default 60 seconds | ||
|
|
||
| console_log="${name}_console.log" | ||
| gst_debug_log="${name}_gst_debug.log" |
There was a problem hiding this comment.
README expects ./logs/..., but run_pipeline_with_logs() currently writes object_detection_console.log in CWD, not ./logs/.
Create ./logs in run.sh and pass logdir to helper, or
Make helper write under ${GST_LOG_DIR:-./logs}.
Runner/utils/lib_gstreamer.sh
Outdated
| mkdir -p "$(dirname "${dest}")" | ||
|
|
||
| if command -v curl >/dev/null 2>&1; then | ||
| curl -fkL "${url}" -o "${dest}" |
There was a problem hiding this comment.
doesn’t verify download success / partial downloads
curl -fkL ... -o is okay, but you should check exit code and file is non-empty to avoid silent failures.
after download: [ -s "$dest" ] || return 1
Runner/utils/lib_gstreamer.sh
Outdated
| cp -r "${tmp_dir}"/* "${dest_dir}/" | ||
|
|
||
| # Clean up the temporary folder; | ||
| rm -rf "${tmp_dir}" "${zip_path}" |
There was a problem hiding this comment.
removes the zip file always. Remove zip only on success, or gate removal behind env var.
Runner/utils/lib_gstreamer.sh
Outdated
| fi | ||
|
|
||
| # ---- Get the actual size ------------------------------------------------- | ||
| size_in_bytes=$(stat -c %s "$input_file_path" 2>/dev/null) || { |
There was a problem hiding this comment.
equires GNU stat -c %s
size_in_bytes=$(stat -c %s "$f" 2>/dev/null || wc -c <"$f" 2>/dev/null)
| printf '%s\n' "filesrc location=${file} ! ${dec} ! audioconvert ! audioresample ! ${sinkElem}" | ||
| return 0 | ||
| } | ||
|
|
There was a problem hiding this comment.
keep mode consistent with existing utilities (usually 100755).
Signed-off-by: Vij Patel <vijpatel@qti.qualcomm.com>
Signed-off-by: Vij Patel <vijpatel@qti.qualcomm.com>
Signed-off-by: Vij Patel <vijpatel@qti.qualcomm.com>
Signed-off-by: root <root@lab7816.ap.qualcomm.com>
ce24ad8 to
6479657
Compare
Signed-off-by: Vij Patel <vijpatel@qti.qualcomm.com>
Signed-off-by: Vij Patel <vijpatel@qti.qualcomm.com>
Signed-off-by: Vij Patel <vijpatel@qti.qualcomm.com>
Signed-off-by: Vij Patel <vijpatel@qti.qualcomm.com>
|
Hi @smuppand, I’ve addressed the comments and updated the code based on the feedback. Could you please review the changes? |
|
@vijpatel22 Please rebase and resolve the conflicts |
Signed-off-by: Vij Patel <vijpatel@qti.qualcomm.com>
|
Hi @smuppand, I’ve resolved the merge conflicts and updated the branch accordingly |
| fi | ||
|
|
||
| # Only source if not already loaded (idempotent) | ||
| if [ -z "$__INIT_ENV_LOADED" ]; then |
There was a problem hiding this comment.
the init_env guard should use the safe unset-resistant form:
if [ -z "${__INIT_ENV_LOADED:-}" ]; then
The current direct expansion of "$__INIT_ENV_LOADED" is still not ideal.
| # Optional: make sure we have network connectivity (kept from the | ||
| # original script) | ||
| # ------------------------------------------------------------------ | ||
| if command -v ensure_network_online >/dev/null 2>&1; then |
There was a problem hiding this comment.
I have added the skip download part if required assets already exists, in latest commit.
asset presence should be checked before forcing network bring-up. Right now the function calls ensure_network_online first, so an offline target can still SKIP even when all required assets are already cached locally. The flow should be:
- first verify all required assets exist and are non-empty
- only if any are missing, bring up network and download
- if network still cannot be brought up, then SKIP
| fi | ||
| GST_DEBUG_LEVEL=$1 | ||
| ;; | ||
| --output-video) |
There was a problem hiding this comment.
the usage/help text is stale for --output-video. It currently says the default is /test_path/video_out.mp4, but the script actually uses ./video_out.mp4 after changing into test_path.
|
|
||
| log_info "Running ${name} (timeout=${TIMEOUT}s)" | ||
| # Check if timeout command is available | ||
| if command -v timeout >/dev/null 2>&1; then |
There was a problem hiding this comment.
please prefer the repo timeout helper path first and only fall back to GNU timeout if the helper is unavailable. We should avoid depending primarily on timeout for minimal Yocto images.
| @@ -0,0 +1,270 @@ | |||
| #!/bin/sh | |||
| # Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries. | |||
| # SPDX-License-Identifier: BSD-3-Clause-Clear | |||
There was a problem hiding this comment.
Update the license to # SPDX-License-Identifier: BSD-3-Clause
PR – Add AI/ML GStreamer Test Suite
Overview
This pull request introduces, a self‑contained test suite for the AI/ML GStreamer suite located at:
Runner/suites/Multimedia/GStreamer/AI_ML/run.sh
The script automates the end‑to‑end validation of object‑detection and image‑classification pipelines that leverage Qualcomm‑specific GStreamer plugins.
It will:
🛠️ What’s Added / Modified
Runner/suites/Multimedia/GStreamer/AI_ML/run.sh- New executable script (the full implementation is attached in this PR).Runner/suites/Multimedia/GStreamer/AI_ML/AI_ML.yaml- New YAML fileRunner/suites/Multimedia/GStreamer/AI_ML/Readme.md- New Readme fileRunner/utils/lib_gstreamer.sh- Added new functions.